import { Navigate, Outlet } from 'react-router-dom';
import { useAuthStore } from '@/stores/auth';

export default function AuthRoute() {
  const isAuthenticated = useAuthStore((state) => state.isAuthenticated);
  if (!isAuthenticated()) {
    return <Navigate to="/login" replace={true} />;
  }

  return <Outlet />;
}
